import 'package:flutter/cupertino.dart';
import 'package:tencent_im_sdk_plugin/models/v2_tim_message.dart';

import '../../../../im_base.dart';

class ChatState {
  String? id;
  late bool isGroup;
  List<V2TimMessage> chatHistory = List.empty(growable: true);
  List<String> photoList=List.empty(growable: true);
  late bool loadMore;
  late LoadStatus status;
  int pageSize = 15;
   ScrollController? chatController;

  ///最后一条消息id,用于加载更多
  String? lastMsgId;

  ///记录上一条消息的时间
  late int currentTime;

  ///记录当前正在播放的语音消息id
  String? currentPlayAudioMsgId;

  ///是否取消发送语音,true取消不发送,false正常发送
  late bool cancleAudio;

  ///是否展示操作菜单(撤回,复制,删除)
  late bool showPopMenu;

  ///当前popMenu所在的坐标值
  double? positionY;
  double? positionX;

  ///当前消息能否撤回,超过五分钟不能撤回
  late bool canWithdraw;

  ///如果当前为文字消息,复制时直接使用消息内容
  String? content;

  ///当前操作消息ID
  String? currendMsgID;

  ///是否为自己发送的消息
  bool? isSelf;
  ///语音录制时长
  int recordLength=0;

  ChatState() {
    canWithdraw = false;
    showPopMenu = false;
    chatController = ScrollController();
    cancleAudio = false;
    status = LoadStatus.LOADING;
    loadMore = false;
    isGroup = false;
    currentTime = DateTime.now().millisecondsSinceEpoch;
  }
}
